{extend name="public/base"/}
{block name="style"}

{/block}
{block name="body"}
<style>
.menuBox{position:absolute;top:20px; left:150px;width:600px; height:35px;}
.menuBox li{float:left;width:65px; height:32px;line-height:32px; text-align:center; font-size:18px;-moz-border-radius:5px;border-radius:5px;}
.menuBox .hove{background:#3baa24; color:#FFF}
.menuBox .hove a{display:block;color:#FFF}
</style>
{include file="public/header" /}

<div class="pageBox userBox" >
	<div class="userLeft">
	    <div class="headPic">
		    <img id="userPicShow" src="{$avatar}">
		    <span>{$nickname}</span>
		</div>
		<ul>
            <li ><a href="{:url('index/user/index')}">我的主页</a></li>
            <li ><a href="{:url('index/user/bookcase')}">我的书架</a></li>
            <li ><a href="{:url('index/user/review')}">我的书评</a></li>
            <li ><a href="{:url('index/user/paylog')}">充值记录</a></li>
            <li ><a href="{:url('index/user/moneylog')}">订阅记录</a></li>
		</ul>    
	</div>
    <div class="userRight">
        <div class="Tit payIco">账户充值<span><a href="/personal/paylog">全部充值</a></span></div>
        <div class="userPayBox">
            <div class="priceTit">充值面额</div>
            <div class="clearfix">
				{volist name="paysetting" id="vo"}
                <div class="priceBox {if $type && $vo.price ==$type}Cxz{else/}{if $i==1}Cxz{/if}{/if}"  data-money='{$vo.price|floatval}'  data-id='{$vo.id}'  data-type='{$vo.type}'>
                	<h5>{$vo.price|floatval}元</h5>
                	<span>
                		{:config('virtualname')}{$vo.egold}<br/>
                		{if $vo.type==1}多送{$vo.giveegold}{:config('virtualname')}{else /}{$vo.description}{/if}
                	</span>
                </div>
                {/volist}
            </div>
            <div class="priceTit">充值方式</div>
            <div class="payTypeBox clearfix">
                <span class="zhifubao" ></span>
                <span class="weixinPay" ></span>
            </div>
        </div>
    </div>
</div>

<div class="MaskBox" id="pc_mask_box" style="display:none">
	<div class="weixinPayEWM">
		<div class="MaskClose">X</div>
		<span id="qr"></span>
		<div class="imgDesc">
			<img src="__PUBLIC__/novel/images/weixinpay.png">
		</div>
	</div>
</div>

{block name="include"}{include file="public:footer" /}{/block}

{/block}
{block name="script"}
	<script type="text/javascript">
		var  pay_change = "{:config('pay_change')}";
		$('.priceBox').click(function(){
			$(".priceBox").each(function(){
			    $(this).removeClass('Cxz');
			});
			$(this).addClass('Cxz');
		})

		$(document).on('click','.zhifubao', function(){
			var money = $(".Cxz").attr("data-money");
            //var money = 0.1;
			var type = $(".Cxz").attr("data-type");
			if (pay_change==2)
			{
				$.ajax({
				  url:'/pay/payalipayqr.html?egold='+money+'&type='+type,
				  async: false,
				  dataType:'text',
				  data : {},
				  type:'get',
				  success:function(qr){
					$('#qr').html(qr);
					$('#pc_mask_box').show();
				  },
				  error:function(){
				  }
				});
			}else{
				document.location.href='/alipay/pay.html?egold='+money+'&type='+type
			}
			
		})

		$(document).on('click','.weixinPay', function(){
			var money = $(".Cxz").attr("data-money");
            //var money = 0.1;
			var type = $(".Cxz").attr("data-type");

			$.ajax({
			  url:'/pay/payqr.html?egold='+money+'&type='+type,
			  async: false,
			  dataType:'text',
			  data : {},
			  type:'get',
			  success:function(qr){
			  	$('#qr').html(qr);
			  	$('#pc_mask_box').show();
			  },
			  error:function(){
			  }
			});
		})
	</script>
{/block}